package dice.sinanya.entity;

import com.forte.qqrobot.beans.messages.types.MsgGetTypes;
import org.nlpcn.commons.lang.util.StringUtil;

import java.util.ArrayList;

public class EntitySendToMaster {
    MsgGetTypes msgGetTypes;
    String messages;
    String qqId;
    String groupId;
    String date;
    String botId;

    public EntitySendToMaster() {
    }

    public EntitySendToMaster(MsgGetTypes msgGetTypes, String messages, String qqId, String groupId, String date, String botId) {
        this.msgGetTypes = msgGetTypes;
        this.messages = messages;
        this.qqId = qqId;
        this.groupId = groupId;
        this.date = date;
        this.botId = botId;
    }

    public MsgGetTypes getMsgGetTypes() {
        return msgGetTypes;
    }

    public void setMsgGetTypes(MsgGetTypes msgGetTypes) {
        this.msgGetTypes = msgGetTypes;
    }

    public String getMessages() {
        return messages;
    }

    public void setMessages(String messages) {
        this.messages = messages;
    }

    public String getQqId() {
        return qqId;
    }

    public void setQqId(String qqId) {
        this.qqId = qqId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getBotId() {
        return botId;
    }

    public void setBotId(String botId) {
        this.botId = botId;
    }

    public String build() {
        ArrayList<String> info = new ArrayList<>();
        info.add("收到意见反馈:");
        info.add("收到反馈的骰娘ID:\t" + botId);
        info.add("时间:\t" + date);
        info.add("反馈来源:\t" + msgGetTypes);
        info.add("反馈人:\t" + qqId);
        if (msgGetTypes != MsgGetTypes.privateMsg) {
            info.add("反馈群号或讨论组号:\t" + groupId);
        }
        info.add("反馈信息:\t" + messages);
        return StringUtil.joiner(info, "\n");
    }
}
